package empty.users;

import java.io.Serializable;
import java.util.Objects;

public class Company implements Serializable {

    private int id;
    private String name;
    private String address;
    private String master;
    private int phone;

    public Company() {
    }

    public Company(String name, String address, String master, int phone) {
        this.name = name;
        this.address = address;
        this.master = master;
        this.phone = phone;
    }

    public Company(int id, String name, String address, String master, int phone) {
        this.id = id;
        this.name = name;
        this.address = address;
        this.master = master;
        this.phone = phone;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getMaster() {
        return master;
    }

    public void setMaster(String master) {
        this.master = master;
    }

    public int getPhone() {
        return phone;
    }

    public void setPhone(int phone) {
        this.phone = phone;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Company company = (Company) o;
        return id == company.id && phone == company.phone && Objects.equals(name, company.name) && Objects.equals(address, company.address) && Objects.equals(master, company.master);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, address, master, phone);
    }

    @Override
    public String toString() {
        return "Company{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", address='" + address + '\'' +
                ", master='" + master + '\'' +
                ", phone=" + phone +
                '}';
    }

    public Object [] toArray(){
        return new Object[]{
                id, name, address, master, phone
        };
    }

}
